﻿using Service.Auth.Domain.AggregatesModel;
using Service.Core.Repository;
using Service.Framework;

namespace Service.Auth.Api.Application.Query;

/// <summary>
/// 用户角色查询器
/// </summary>
/// <param name="userRoleRepository"></param>
public class UserRoleQueryService(IRepository<UserSystemRole> userRoleRepository) : IScopedService
{
    /// <summary>
    /// 
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public async Task<List<UserSystemRole>> QueryUserRoleByUserId(long id)
    {
        return await userRoleRepository.GetListAsync(s => s.UserId.Equals(id));
    }
}